package com.how2java.tmall.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.how2java.tmall.mapper.PropertyMapper;
import com.how2java.tmall.pojo.Property;
import com.how2java.tmall.service.PropertyService;


@Service
public class PropertyServiceImpl implements PropertyService {
	@Autowired
	private PropertyMapper dao;
	

	@Override
	public int add(Property c) {
		return dao.insertSelective(c);
	}

	@Override
	public int delete(int id) {
		return dao.deleteByPrimaryKey(id);
	}

	@Override
	public int update(Property c) {
		return dao.updateByPrimaryKeySelective(c);
		
	}

	@Override
	public Property get(int id) {
		return dao.selectByPrimaryKey(id);
	}

	@Override
	public List<Property> list(int cid) {
		return dao.getByCid(cid);
	}

}
